/**
 * Created by yyj on 2015/10/28.
 */
var $path=$("#webPath").val();
$(function(){
	 initCheckdata();
	 initButton();
    //点击关闭按钮
   
});

function initButton(){
	    $('.press_btn2.Close').click(function(){
	        var index = parent.layer.getFrameIndex(window.name);
	        parent.layer.close(index);
	    });
	    
	    $('.press_btn1').click(function(){
	    	save();
	    });
}


function save(){
	if(!checkData()) return;
	var linkManGroupName = $("#linkManGroupName").val().trim();
	var desc = $("#desc").val().trim();
	var remark = $("#remark").val().trim();
	$.ajax({
		url : basePath+"/radar/linkGroup/savelinkGroup.do",
		type: "POST",
		dataType:"json",
		data : {
			"editflag":editflag,
			"linkmansGroupId":linkmansGroupId,
			"linkmansGroupName":linkManGroupName,
			"desc":desc,
			"remark":remark
		},
		success:function(data){
			if(data.errorMessage == ""){
				layer.msg('保存成功！', {icon : 1});
				parent.reQuery('linkGroup');
				closeWindow();
			}else{
				layer.msg('保存失败！', {icon : 1});
				parent.reQuery('linkGroup');
				closeWindow();
			}
		}
	});
}